geneloc<-read.table("geneloc.txt",sep="\t",head=T)
geneexp<-read.table("OGE.txt",sep="\t",head=T)
list<-read.table("file_listgene_top55_chen",sep="\t",head=T)
rownames(geneloc)<-geneloc[,1]
rownames(geneexp)<-geneexp[,1]
list<-as.vector(t(list))
list_geneloc<-geneloc[as.character(list),]
list_geneexp<-geneexp[as.character(list),]
list_merged<-cbind(list_geneloc,list_geneexp)
list_merged<-list_merged[with(list_merged, order(chrm_probe, s1)), ]
x<-list_merged[,6:ncol(list_merged)]
rownames<-list_merged$geneid
colnames<-colnames(list_merged)[6:ncol(list_merged)]
colnames(x)<-colnames
rownames(x)<- rownames
x1<-as.matrix(x,is.numeric=T)
colnames(x1)<-colnames
rownames(x1)<-rownames
x<-x1
rownames<-paste(rownames,list_merged$chrm_probe,list_merged$s1,sep="_")
rownames(x)<-rownames
library("gplots")
library("heatmap.plus")
pdf("heatmap.pdf")
heatmap.plus(x,cexRow=0.5,Rowv=NA,cexCol=0.25)
dev.off()
pdf("heatmap_unsorted.pdf")
heatmap(x,cexRow=0.5,cexCol=0.25)
dev.off()
